﻿Imports System.ComponentModel
Imports System.Reflection
Imports System.ComponentModel.Design.Serialization
Imports System

<TypeConverter(GetType(ErrMessagePropertiesConverter))> _
Public Class ErrMessageProperties
   Friend Parent As NumericInputBox

   Friend Sub New(ByVal Parent As NumericInputBox)
      Me.Parent = Parent
   End Sub

   Public Enum MessageBoxDisplayMode
      DoNotDisplay
      DisplayWithBeep
      DisplayWithOutBeep
   End Enum

   Private _DisplayMessageBox As MessageBoxDisplayMode = MessageBoxDisplayMode.DisplayWithBeep

   <DisplayName("1. Display Err Messagebox")> _
   Public Property DisplayMessageBox() As MessageBoxDisplayMode
      Get
         Return _DisplayMessageBox
      End Get
      Set(ByVal value As MessageBoxDisplayMode)
         _DisplayMessageBox = value
      End Set
   End Property 'DisplayMessageBox

   <DisplayName("2. Name used in err messages")> _
   <Description("Name to display in err messages")> _
   Public Property ErrName() As String
      Get
         If _ErrName = String.Empty Then
            _ErrName = Parent.Name
         End If
         Return _ErrName
      End Get
      Set(ByVal value As String)
         If value = String.Empty Then
            _ErrName = Parent.Name
         Else
            _ErrName = value
         End If
      End Set
   End Property 'ErrName

   Private _InputBoxAnchorPoint As InfoBox.AnchorPoint = AnchorPoint.TopRight

   <DisplayName("3. InputBox Anchor Point")> _
   Public Property InputBoxAnchorPoint() As InfoBox.AnchorPoint
      Get
         Return _InputBoxAnchorPoint
      End Get
      Set(ByVal value As InfoBox.AnchorPoint)
         _InputBoxAnchorPoint = value
      End Set
   End Property 'InputBoxAnchorPoint

   Private _DiaplayedMessageBoxAnchorPoint As InfoBox.AnchorPoint = AnchorPoint.TopLeft

   <DisplayName("4. Err MessageBox Anchor Point")> _
   Public Property DisplayedMessageBoxAnchorPoint() As InfoBox.AnchorPoint
      Get
         Return _DiaplayedMessageBoxAnchorPoint
      End Get
      Set(ByVal value As InfoBox.AnchorPoint)
         _DiaplayedMessageBoxAnchorPoint = value
      End Set
   End Property 'DiaplayedMessageBoxAnchorPoint

   Private _ErrName As String = String.Empty


End Class

